package study.nosql.mongodb.dao.item;

import org.springframework.data.mongodb.core.query.Criteria;
import org.springframework.data.mongodb.core.query.Query;
import org.springframework.stereotype.Repository;
import study.nosql.mongodb.dao.BaseDao;

import java.util.List;

@Repository
public class ItemDao extends BaseDao<ItemDoc> {

    public List<ItemDoc> getByIds(List<String> idLt) {
        Criteria criteria = Criteria.where("_id")
                .in(idLt);
        Query query = new Query(criteria);
        return mongoTemplate.find(query, ItemDoc.class);
    }
}
